import request from '@/utils/request'

// 查询分解任务列表
export function listTargetTask(query) {
  return request({
    url: '/targetTask/targetTask/list',
    method: 'get',
    params: query
  })
}

// 查询分解任务列表
export function listTargetTaskForItem(query) {
  return request({
    url: '/targetTask/targetTask/listForItem',
    method: 'get',
    params: query
  })
}

// 查询分解任务详细
export function getTargetTask(targetTaskId) {
  return request({
    url: '/targetTask/targetTask/' + targetTaskId,
    method: 'get'
  })
}

// 新增分解任务
export function addTargetTask(data) {
  return request({
    url: '/targetTask/targetTask',
    method: 'post',
    data: data
  })
}

// 修改分解任务
export function updateTargetTask(data) {
  return request({
    url: '/targetTask/targetTask',
    method: 'put',
    data: data
  })
}

// 修改任务
export function updateTargetTaskById(data) {
  return request({
    url: '/targetTask/targetTask/updateById',
    method: 'put',
    data: data
  })
}

// 删除分解任务
export function delTargetTask(targetTaskId) {
  return request({
    url: '/targetTask/targetTask/' + targetTaskId,
    method: 'delete'
  })
}
// 查询任务列表
export function getTargetTaskList(query) {
  return request({
    url: '/targetTask/targetTask/getTargetTaskList',
    method: 'get',
    params: query
  })
}
